/*
 * 项目名称:    wms-server-jeecg
 * 创建人员:    FangYongliang
 * 创建时间:    2023-10-13
 */
package org.jeecg.modules.dock.handler;

import org.jeecg.modules.dock.service.MesDockingRepeaterService;
import org.jeecg.modules.flow.sys.entity.dto.BaseFlowDto;
import org.jeecg.modules.flow.sys.service.WorkFlowService;
import org.jeecg.modules.flow.sys.util.SpringContextUtil;

/**
 * //TODO 【请填写类描述】
 *
 * @author FangYongliang
 * @version 1.0.0
 * @since 2023-10-13
 */
public interface StatusHandler<T> {

    WorkFlowService workFlowService = SpringContextUtil.getBean(WorkFlowService.class);
    void handle(T t);

    default void cancelFlow(String infoId){
        BaseFlowDto base = new BaseFlowDto();
        base.setInfoId(infoId);
        base.setRefuseType(3);
        base.setRemark("取消配送");
        workFlowService.interrupt(base);
    }

    /**
     * 暂停配送，暂停流程
     */
    default void pauseFlow(String infoId){
        workFlowService.pauseFlow(infoId,"暂停配送");
    }
}
